<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('system_operation_logs', function (Blueprint $table) {
            $table->id();

            $table->unsignedInteger('strator_id')->nullable()->index()->comment('操作人id');
            $table->char('operation_type',64)->nullable()->index()->comment('操作类型');
            $table->text('original_data')->nullable()->comment('原始数据');
            $table->text('param')->nullable()->comment('请求参数');
            $table->char('extra',64)->nullable()->index()->comment('附加信息');

            $table->timestamps();
            $table->softDeletes();
        });

        \DB::statement("ALTER TABLE `system_operation_logs` comment '系统操作日志表'");
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('system_operation_logs');
    }
};
